<?php

namespace app\common\model\shop;

use think\Model;


class Data extends Model
{

    

    

    // 表名
    protected $name = 'shop_data';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'cate'
    ];
    

    
    public function cate()
    {
        return $this->belongsTo('app\common\model\factory\Category', 'category_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }






    public function factory()
    {
        return $this->belongsTo('app\common\model\User', 'factory_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function category()
    {
        return $this->belongsTo('app\common\model\factory\Category', 'category_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function shop()
    {
        return $this->belongsTo('app\common\model\User', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
